/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vamprest;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author sav
 */
@Entity
@Table(name = "status")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Status.findAll", query = "SELECT s FROM Status s"),
    @NamedQuery(name = "Status.findByIdstatus", query = "SELECT s FROM Status s WHERE s.idstatus = :idstatus")})
public class Status implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "idstatus")
    private Integer idstatus;
    @Size(max = 65535)
    @Column(name = "status")
    private String status;
    @Column(name = "available")
    private int available;
    @Column(name = "inprocess")
    private int inprocess;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idstatus")
    private Collection<Nfcequipment> nfcequipmentCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idstatus")
    private Collection<Vehiclestatus> vehiclestatusCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idstatus")
    private Collection<Vehicle> vehicleCollection;

    public Status() {
    }

    public Status(Integer idstatus) {
        this.idstatus = idstatus;
    }

    public Integer getIdstatus() {
        return idstatus;
    }

    public void setIdstatus(Integer idstatus) {
        this.idstatus = idstatus;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public int getAvailable() {
        return available;
    }

    public void setAvailable(int available) {
        this.available = available;
    }

    public int getInprocess() {
        return inprocess;
    }

    public void setInprocess(int inprocess) {
        this.inprocess = inprocess;
    }

    @XmlTransient
    public Collection<Nfcequipment> getNfcequipmentCollection() {
        return nfcequipmentCollection;
    }

    public void setNfcequipmentCollection(Collection<Nfcequipment> nfcequipmentCollection) {
        this.nfcequipmentCollection = nfcequipmentCollection;
    }

    @XmlTransient
    public Collection<Vehiclestatus> getVehiclestatusCollection() {
        return vehiclestatusCollection;
    }

    public void setVehiclestatusCollection(Collection<Vehiclestatus> vehiclestatusCollection) {
        this.vehiclestatusCollection = vehiclestatusCollection;
    }

    @XmlTransient
    public Collection<Vehicle> getVehicleCollection() {
        return vehicleCollection;
    }

    public void setVehicleCollection(Collection<Vehicle> vehicleCollection) {
        this.vehicleCollection = vehicleCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idstatus != null ? idstatus.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Status)) {
            return false;
        }
        Status other = (Status) object;
        if ((this.idstatus == null && other.idstatus != null) || (this.idstatus != null && !this.idstatus.equals(other.idstatus))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "vamprest.Status[ idstatus=" + idstatus + " ]";
    }

}
